<?php session_start(); ?>
<?php
if ($_SESSION['tipo'] != "MembroExterno") {
    header('Location: ../login_error.html');
}
?>
<!DOCTYPE html>
<html lang="pt-BR">
    <head>
        <title>SisKepler</title>
        <meta charset="UTF-8">
        <link rel="icon" type="image/png" href="../../../library/img/favicon.png" />
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="../../../library/css/bootstrap/bootstrap.css" media="screen">
        <link rel="stylesheet" href="../../../library/css/style.css">
        <script src="../../../library/css/bootstrap/js/jquery.js"></script>
        <script src="../../../library/css/bootstrap/js/bootstrap.js"></script>
        <script src="../../../library/js/tooltipsy.min.js"></script>
    </head>
    <body>
        <div class="wrap">
            <header class="header">
                <div class="navbar navbar-default">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="#">
                            <div class="col-lg-2"></div>
                            <div class="col-lg-3"><strong>SisKepler</strong></div>
                        </a>
                    </div>
                    <div class="navbar-collapse collapse navbar-responsive-collapse btn-sair">
                        <ul class="nav navbar-nav navbar-right">
                            <li><a href="../login_close.php" class="a-btn-sair">Sair</a></li>
                        </ul>
                    </div>       

                </div>

                <ul class="breadcrumb">
                    <li class="active">Home</li>
                </ul>

            </header>

            <div class="main row">

                <aside class="menu-vertical col-lg-3">

                    <div class="menu">
                        <ul class="nav nav-pills nav-stacked">
                            <li class=""><a href="menu.membroExterno.php">Perfil</a></li>
                            <li class=""><a href="menu.membroExterno.php?page=orientacao">Orientação</a></li>
                            <li class=""><a href="menu.membroExterno.php?page=bancas">Bancas</a></li>
                        </ul>
                    </div>

                </aside>

                <section class="col-lg-7 principal" id="principal"  style="padding-top: 1%;">
                    <?php if (!isset($_REQUEST['page'])): ?>
                        <div class="well perfil">
                            <div class="row">  
                                <div class="col-lg-3"></div>
                                <div class="col-lg-6">
                                    <img style="width:38%;" src="../../../library/img/user.png" class="img-circle"/>
                                </div>
                                <div class="col-lg-3">
                                    <button class="btn btn-sm btn-success" data-toggle="modal" data-target="#editarPerfil">Editar Perfil</button>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-3"></div>
                                <div class="col-lg-6">

                                    <?php
                                    $nome = $_SESSION['nome'];
                                    $email = $_SESSION['email'];
                                    $inst = $_SESSION['univers'];

                                    echo "<h3><label id=\"nome\">" . "$nome" . "</label></h3>";
                                    echo "<h6><label>Insituição:</label><span id=\"instituicao\">" . $inst . "</span></h6>";
                                    echo "<h6><label>Email:</label>: <span id=\"email\">" . "$email" . "</span></h6>";
                                    ?>
                                </div> </div>
                        </div>
                        <?php
                    else:
                        include($_REQUEST['page'] . ".php");
                    endif;
                    ?>
            </div>
            <div class="col-lg-1"></div>

        </section>  

        <div class="col-lg-3"></div>
        <footer class="footer row">

            <div class="text-copyright">
                <p>
                    &copy; 2014 <strong>Grupo I/ Disciplina de RP5</strong> - 		Todos os direitos reservados.
                </p>
            </div>

        </footer>
        <div class="col-lg-3"></div>

        <!-- Modal -->
        <div class="modal fade" id="editarPerfil" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title" id="myModalLabel">Editar Perfil</h4>
                    </div>
                    <div class="modal-body row">
                        <div class="col-lg-1"></div>
                        <form class="form-horizontal col-lg-10" id="editarPerfil" action="../../../controller/TrataEditarPerfil.php" method="POST">

                            <div class="form-group">
                                <label for="inputNome" class="col-lg-3 control-label">Nome: </label>
                                <div class="col-lg-8">
                                    <?php
                                    echo "<input type=\"text\" class=\"form-control\" "
                                    . "name=\"nome\" id=\"inputNome\" size=\"\" value=\"" . $_SESSION['nome'] . "\">";
                                    ?>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="inputInstituicao" class="col-lg-3 control-label">Instituição: </label>
                                <div class="col-lg-8">
                                    <?php
                                    echo "<input type=\"text\" class=\"form-control\" "
                                    . "name=\"instituicao\" id=\"inputInstituicao\" size=\"\" value=\"" . $_SESSION['univers'] . "\">";
                                    ?>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="inputEmail" class="col-lg-3 control-label">E-mail: </label>
                                <div class="col-lg-8">
                                    <?php
                                    echo "<input type=\"email\" class=\"form-control\" "
                                    . "name=\"Email\" id=\"inputEmail\" size=\"\" value=\"" . $_SESSION['email'] . "\">";
                                    ?>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="inputSenha" class="col-lg-3 control-label">Senha: </label>
                                <div class="col-lg-8">
                                    <input type="password" class="form-control" name="senha" id="inputSenha">
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button id="btn-editar"  type="submit" class="btn btn-success" >Salvar</button>
                                <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
                            </div>
                        </form>   
                    </div>
                </div>
            </div>
        </div>
</body>
</html>
